//
//  LGPatientAttendClassificationCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/5/24.
//  纽约心功能分级

#import "LGPatientAttendClassificationCell.h"

@interface LGPatientAttendClassificationCell() 
/**   */
@property (nonatomic , strong)UIView *baseView;
/**   */
@property (nonatomic , strong)UIView *shadowView;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;

@end

@implementation LGPatientAttendClassificationCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return  self;
}

-(void)setTitle:(NSString *)title{
    _title = title;
    self.titleLabel.text = title;
}

-(void)setSelect:(BOOL)select{
    _select = select;
    if(select == YES){
        self.shadowView.hidden = NO;
        self.titleLabel.textColor = [UIColor colorWithString:@"#2E9AFC"];
        self.titleLabel.font = LGFontWeight(13, UIFontWeightMedium);
    }else{
        self.shadowView.hidden = YES;
        self.titleLabel.textColor = [UIColor colorWithString:@"#666666"];
        self.titleLabel.font = LGFont(13);
    }
}

-(void)createSubView{
    self.clipsToBounds = YES;
    self.contentView.backgroundColor = [UIColor colorWithString:@"#F9F9F9"];
    [self.contentView addSubview:self.baseView];
    [self.contentView addSubview:self.shadowView];
    [self.contentView addSubview:self.titleLabel];

    [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.equalTo(self.contentView).offset(viewPix(16));
        make.top.right.equalTo(self.contentView).offset(-viewPix(16));
    }];
    [self.shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.baseView).offset(viewPix(11));
        make.top.equalTo(self.contentView).offset(viewPix(4));
        make.bottom.equalTo(self.contentView).offset(-viewPix(4));
        make.right.equalTo(self.baseView).offset(-viewPix(15));
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.baseView).offset(viewPix(27));
        make.top.equalTo(self.contentView).offset(viewPix(10));
        make.bottom.equalTo(self.contentView).offset(-viewPix(10));
        make.right.equalTo(self.baseView).offset(-viewPix(35));
    }];
}


-(UIView *)baseView{
    if(!_baseView){
        _baseView = [UIView shadowViewWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.15 radius:10];
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}

-(UIView *)shadowView{
    if(!_shadowView){
        _shadowView = [[UIView alloc] init];
        _shadowView.backgroundColor = [UIColor colorWithString:@"#EAF4FF"];
        _shadowView.cornerRidus = 5;
    }
    return _shadowView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:2];
    }
    return _titleLabel;
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
